import React, { PureComponent } from 'react';
import { Row, Col } from 'antd';
import uuid from 'es6-uuid';

export default class InfoListC extends PureComponent {
  render() {
    const { data, infoList, marginLeft, width } = this.props;
    return (
      <Row className={'info_list'}>
        {infoList.map((item) => {
          const info = data[item.map];
          const value = info[item.value] || '--';
          const cls = item.isHidden == true ? 'fanwei' : '';
          return (
            <Col key={uuid(6)} lg={item.size} className={`table_row ${cls}`}>
              <span style={{ width: width }}>{`${item.name}:`}</span>
              <span style={{ marginLeft }} title={cls ? value : ''}>
                {value}
              </span>
            </Col>
          );
        })}
      </Row>
    );
  }
}
